{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "*日期：2022年11月09日\n",
    "\n",
    "*课程：python\n",
    "\n",
    "*记录人：林锦纯"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "案例：https://docs.python.org/3/tutorial/datastructures.html#sets\n",
    "\n",
    "方法：https://docs.python.org/3/library/stdtypes.html#mapping-types-d"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "期末项目：bootatrap"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "pycharm"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "gihub student education —— developer pack"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 1.函数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "def greet_user():\n",
    "    \"\"\"用户问候语\"\"\"\n",
    "    print(\"hello world\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hello world\n"
     ]
    }
   ],
   "source": [
    "greet_user()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "def greet_user(username):\n",
    "    \"\"\"用户问候语\"\"\"\n",
    "    print(\"hello\",username)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hello 李华\n"
     ]
    }
   ],
   "source": [
    "greet_user(username=\"李华\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 函数的意义 1.重复使用\n",
    "            2.可以给了解python的人使用"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "# 实践 ： 广州南方学院新闻网站url实践\n",
    "def NFU_NEWS_URL(分类,页码):\n",
    "    \"\"\"广州南方学院新闻页面URLh数据\n",
    "       分类只需要写对应的编码就可以，对应的编码如下\n",
    "       分类包含:【学习要闻：xxyw，校园动态：xydt。通知公告；tzgg，招投标：ztd】\n",
    "       页码包含：【113，106，37，27】\n",
    "    \"\"\"\n",
    "    \n",
    "    for i in range(页码):\n",
    "        print (\"https://www.nfu.edu.cn/\" + 分类 + \"/index\"+str(i)+\".html\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "https://www.nfu.edu.cn/xxyw/index0.html\n",
      "https://www.nfu.edu.cn/xxyw/index1.html\n",
      "https://www.nfu.edu.cn/xxyw/index2.html\n",
      "https://www.nfu.edu.cn/xxyw/index3.html\n",
      "https://www.nfu.edu.cn/xxyw/index4.html\n",
      "https://www.nfu.edu.cn/xxyw/index5.html\n",
      "https://www.nfu.edu.cn/xxyw/index6.html\n",
      "https://www.nfu.edu.cn/xxyw/index7.html\n",
      "https://www.nfu.edu.cn/xxyw/index8.html\n",
      "https://www.nfu.edu.cn/xxyw/index9.html\n",
      "https://www.nfu.edu.cn/xxyw/index10.html\n",
      "https://www.nfu.edu.cn/xxyw/index11.html\n",
      "https://www.nfu.edu.cn/xxyw/index12.html\n",
      "https://www.nfu.edu.cn/xxyw/index13.html\n",
      "https://www.nfu.edu.cn/xxyw/index14.html\n",
      "https://www.nfu.edu.cn/xxyw/index15.html\n",
      "https://www.nfu.edu.cn/xxyw/index16.html\n",
      "https://www.nfu.edu.cn/xxyw/index17.html\n",
      "https://www.nfu.edu.cn/xxyw/index18.html\n",
      "https://www.nfu.edu.cn/xxyw/index19.html\n",
      "https://www.nfu.edu.cn/xxyw/index20.html\n",
      "https://www.nfu.edu.cn/xxyw/index21.html\n",
      "https://www.nfu.edu.cn/xxyw/index22.html\n",
      "https://www.nfu.edu.cn/xxyw/index23.html\n",
      "https://www.nfu.edu.cn/xxyw/index24.html\n",
      "https://www.nfu.edu.cn/xxyw/index25.html\n",
      "https://www.nfu.edu.cn/xxyw/index26.html\n",
      "https://www.nfu.edu.cn/xxyw/index27.html\n",
      "https://www.nfu.edu.cn/xxyw/index28.html\n",
      "https://www.nfu.edu.cn/xxyw/index29.html\n",
      "https://www.nfu.edu.cn/xxyw/index30.html\n",
      "https://www.nfu.edu.cn/xxyw/index31.html\n",
      "https://www.nfu.edu.cn/xxyw/index32.html\n",
      "https://www.nfu.edu.cn/xxyw/index33.html\n",
      "https://www.nfu.edu.cn/xxyw/index34.html\n",
      "https://www.nfu.edu.cn/xxyw/index35.html\n",
      "https://www.nfu.edu.cn/xxyw/index36.html\n",
      "https://www.nfu.edu.cn/xxyw/index37.html\n",
      "https://www.nfu.edu.cn/xxyw/index38.html\n",
      "https://www.nfu.edu.cn/xxyw/index39.html\n",
      "https://www.nfu.edu.cn/xxyw/index40.html\n",
      "https://www.nfu.edu.cn/xxyw/index41.html\n",
      "https://www.nfu.edu.cn/xxyw/index42.html\n",
      "https://www.nfu.edu.cn/xxyw/index43.html\n",
      "https://www.nfu.edu.cn/xxyw/index44.html\n",
      "https://www.nfu.edu.cn/xxyw/index45.html\n",
      "https://www.nfu.edu.cn/xxyw/index46.html\n",
      "https://www.nfu.edu.cn/xxyw/index47.html\n",
      "https://www.nfu.edu.cn/xxyw/index48.html\n",
      "https://www.nfu.edu.cn/xxyw/index49.html\n",
      "https://www.nfu.edu.cn/xxyw/index50.html\n",
      "https://www.nfu.edu.cn/xxyw/index51.html\n",
      "https://www.nfu.edu.cn/xxyw/index52.html\n",
      "https://www.nfu.edu.cn/xxyw/index53.html\n",
      "https://www.nfu.edu.cn/xxyw/index54.html\n",
      "https://www.nfu.edu.cn/xxyw/index55.html\n",
      "https://www.nfu.edu.cn/xxyw/index56.html\n",
      "https://www.nfu.edu.cn/xxyw/index57.html\n",
      "https://www.nfu.edu.cn/xxyw/index58.html\n",
      "https://www.nfu.edu.cn/xxyw/index59.html\n",
      "https://www.nfu.edu.cn/xxyw/index60.html\n",
      "https://www.nfu.edu.cn/xxyw/index61.html\n",
      "https://www.nfu.edu.cn/xxyw/index62.html\n",
      "https://www.nfu.edu.cn/xxyw/index63.html\n",
      "https://www.nfu.edu.cn/xxyw/index64.html\n",
      "https://www.nfu.edu.cn/xxyw/index65.html\n",
      "https://www.nfu.edu.cn/xxyw/index66.html\n",
      "https://www.nfu.edu.cn/xxyw/index67.html\n",
      "https://www.nfu.edu.cn/xxyw/index68.html\n",
      "https://www.nfu.edu.cn/xxyw/index69.html\n",
      "https://www.nfu.edu.cn/xxyw/index70.html\n",
      "https://www.nfu.edu.cn/xxyw/index71.html\n",
      "https://www.nfu.edu.cn/xxyw/index72.html\n",
      "https://www.nfu.edu.cn/xxyw/index73.html\n",
      "https://www.nfu.edu.cn/xxyw/index74.html\n",
      "https://www.nfu.edu.cn/xxyw/index75.html\n",
      "https://www.nfu.edu.cn/xxyw/index76.html\n",
      "https://www.nfu.edu.cn/xxyw/index77.html\n",
      "https://www.nfu.edu.cn/xxyw/index78.html\n",
      "https://www.nfu.edu.cn/xxyw/index79.html\n",
      "https://www.nfu.edu.cn/xxyw/index80.html\n",
      "https://www.nfu.edu.cn/xxyw/index81.html\n",
      "https://www.nfu.edu.cn/xxyw/index82.html\n",
      "https://www.nfu.edu.cn/xxyw/index83.html\n",
      "https://www.nfu.edu.cn/xxyw/index84.html\n",
      "https://www.nfu.edu.cn/xxyw/index85.html\n",
      "https://www.nfu.edu.cn/xxyw/index86.html\n",
      "https://www.nfu.edu.cn/xxyw/index87.html\n",
      "https://www.nfu.edu.cn/xxyw/index88.html\n",
      "https://www.nfu.edu.cn/xxyw/index89.html\n",
      "https://www.nfu.edu.cn/xxyw/index90.html\n",
      "https://www.nfu.edu.cn/xxyw/index91.html\n",
      "https://www.nfu.edu.cn/xxyw/index92.html\n",
      "https://www.nfu.edu.cn/xxyw/index93.html\n",
      "https://www.nfu.edu.cn/xxyw/index94.html\n",
      "https://www.nfu.edu.cn/xxyw/index95.html\n",
      "https://www.nfu.edu.cn/xxyw/index96.html\n",
      "https://www.nfu.edu.cn/xxyw/index97.html\n",
      "https://www.nfu.edu.cn/xxyw/index98.html\n",
      "https://www.nfu.edu.cn/xxyw/index99.html\n",
      "https://www.nfu.edu.cn/xxyw/index100.html\n",
      "https://www.nfu.edu.cn/xxyw/index101.html\n",
      "https://www.nfu.edu.cn/xxyw/index102.html\n",
      "https://www.nfu.edu.cn/xxyw/index103.html\n",
      "https://www.nfu.edu.cn/xxyw/index104.html\n",
      "https://www.nfu.edu.cn/xxyw/index105.html\n"
     ]
    }
   ],
   "source": [
    "NFU_NEWS_URL(\"xxyw\",106)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on function NFU_NEWS_URL in module __main__:\n",
      "\n",
      "NFU_NEWS_URL(分类, 页码)\n",
      "    广州南方学院新闻页面URLh数据\n",
      "    分类包含:【学习要闻：xxyw，校园动态：xydt。通知公告；tzgg，招投标：ztd】\n",
      "    页码包含：【113，106，37，27】\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(NFU_NEWS_URL)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "NFU_NEWS_URL('xydt'，)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 2.模块"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [],
   "source": [
    "import colloge_url_crawl"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on function NFU_NEWS_URL in module colloge_url_crawl:\n",
      "\n",
      "NFU_NEWS_URL(分类, 页码)\n",
      "    广州南方学院新闻页面URLh数据\n",
      "    分类只需要写对应的编码就可以，对应的编码如下\n",
      "    分类包含:【学习要闻：xxyw，校园动态：xydt。通知公告；tzgg，招投标：ztd】\n",
      "    页码包含：【113，106，37，27】\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(colloge_url_crawl.NFU_NEWS_URL)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "https://www.nfu.edu.cn/xydt/index0.html\n",
      "https://www.nfu.edu.cn/xydt/index1.html\n",
      "https://www.nfu.edu.cn/xydt/index2.html\n",
      "https://www.nfu.edu.cn/xydt/index3.html\n",
      "https://www.nfu.edu.cn/xydt/index4.html\n",
      "https://www.nfu.edu.cn/xydt/index5.html\n",
      "https://www.nfu.edu.cn/xydt/index6.html\n",
      "https://www.nfu.edu.cn/xydt/index7.html\n",
      "https://www.nfu.edu.cn/xydt/index8.html\n",
      "https://www.nfu.edu.cn/xydt/index9.html\n",
      "https://www.nfu.edu.cn/xydt/index10.html\n",
      "https://www.nfu.edu.cn/xydt/index11.html\n",
      "https://www.nfu.edu.cn/xydt/index12.html\n",
      "https://www.nfu.edu.cn/xydt/index13.html\n",
      "https://www.nfu.edu.cn/xydt/index14.html\n",
      "https://www.nfu.edu.cn/xydt/index15.html\n",
      "https://www.nfu.edu.cn/xydt/index16.html\n",
      "https://www.nfu.edu.cn/xydt/index17.html\n",
      "https://www.nfu.edu.cn/xydt/index18.html\n",
      "https://www.nfu.edu.cn/xydt/index19.html\n",
      "https://www.nfu.edu.cn/xydt/index20.html\n",
      "https://www.nfu.edu.cn/xydt/index21.html\n",
      "https://www.nfu.edu.cn/xydt/index22.html\n",
      "https://www.nfu.edu.cn/xydt/index23.html\n",
      "https://www.nfu.edu.cn/xydt/index24.html\n",
      "https://www.nfu.edu.cn/xydt/index25.html\n",
      "https://www.nfu.edu.cn/xydt/index26.html\n",
      "https://www.nfu.edu.cn/xydt/index27.html\n",
      "https://www.nfu.edu.cn/xydt/index28.html\n",
      "https://www.nfu.edu.cn/xydt/index29.html\n",
      "https://www.nfu.edu.cn/xydt/index30.html\n",
      "https://www.nfu.edu.cn/xydt/index31.html\n",
      "https://www.nfu.edu.cn/xydt/index32.html\n",
      "https://www.nfu.edu.cn/xydt/index33.html\n",
      "https://www.nfu.edu.cn/xydt/index34.html\n",
      "https://www.nfu.edu.cn/xydt/index35.html\n",
      "https://www.nfu.edu.cn/xydt/index36.html\n",
      "https://www.nfu.edu.cn/xydt/index37.html\n",
      "https://www.nfu.edu.cn/xydt/index38.html\n",
      "https://www.nfu.edu.cn/xydt/index39.html\n",
      "https://www.nfu.edu.cn/xydt/index40.html\n",
      "https://www.nfu.edu.cn/xydt/index41.html\n",
      "https://www.nfu.edu.cn/xydt/index42.html\n",
      "https://www.nfu.edu.cn/xydt/index43.html\n",
      "https://www.nfu.edu.cn/xydt/index44.html\n",
      "https://www.nfu.edu.cn/xydt/index45.html\n",
      "https://www.nfu.edu.cn/xydt/index46.html\n",
      "https://www.nfu.edu.cn/xydt/index47.html\n",
      "https://www.nfu.edu.cn/xydt/index48.html\n",
      "https://www.nfu.edu.cn/xydt/index49.html\n",
      "https://www.nfu.edu.cn/xydt/index50.html\n",
      "https://www.nfu.edu.cn/xydt/index51.html\n",
      "https://www.nfu.edu.cn/xydt/index52.html\n",
      "https://www.nfu.edu.cn/xydt/index53.html\n",
      "https://www.nfu.edu.cn/xydt/index54.html\n",
      "https://www.nfu.edu.cn/xydt/index55.html\n",
      "https://www.nfu.edu.cn/xydt/index56.html\n",
      "https://www.nfu.edu.cn/xydt/index57.html\n",
      "https://www.nfu.edu.cn/xydt/index58.html\n",
      "https://www.nfu.edu.cn/xydt/index59.html\n",
      "https://www.nfu.edu.cn/xydt/index60.html\n",
      "https://www.nfu.edu.cn/xydt/index61.html\n",
      "https://www.nfu.edu.cn/xydt/index62.html\n",
      "https://www.nfu.edu.cn/xydt/index63.html\n",
      "https://www.nfu.edu.cn/xydt/index64.html\n",
      "https://www.nfu.edu.cn/xydt/index65.html\n",
      "https://www.nfu.edu.cn/xydt/index66.html\n",
      "https://www.nfu.edu.cn/xydt/index67.html\n",
      "https://www.nfu.edu.cn/xydt/index68.html\n",
      "https://www.nfu.edu.cn/xydt/index69.html\n",
      "https://www.nfu.edu.cn/xydt/index70.html\n",
      "https://www.nfu.edu.cn/xydt/index71.html\n",
      "https://www.nfu.edu.cn/xydt/index72.html\n",
      "https://www.nfu.edu.cn/xydt/index73.html\n",
      "https://www.nfu.edu.cn/xydt/index74.html\n",
      "https://www.nfu.edu.cn/xydt/index75.html\n",
      "https://www.nfu.edu.cn/xydt/index76.html\n",
      "https://www.nfu.edu.cn/xydt/index77.html\n",
      "https://www.nfu.edu.cn/xydt/index78.html\n",
      "https://www.nfu.edu.cn/xydt/index79.html\n",
      "https://www.nfu.edu.cn/xydt/index80.html\n",
      "https://www.nfu.edu.cn/xydt/index81.html\n",
      "https://www.nfu.edu.cn/xydt/index82.html\n",
      "https://www.nfu.edu.cn/xydt/index83.html\n",
      "https://www.nfu.edu.cn/xydt/index84.html\n",
      "https://www.nfu.edu.cn/xydt/index85.html\n",
      "https://www.nfu.edu.cn/xydt/index86.html\n",
      "https://www.nfu.edu.cn/xydt/index87.html\n",
      "https://www.nfu.edu.cn/xydt/index88.html\n",
      "https://www.nfu.edu.cn/xydt/index89.html\n",
      "https://www.nfu.edu.cn/xydt/index90.html\n",
      "https://www.nfu.edu.cn/xydt/index91.html\n",
      "https://www.nfu.edu.cn/xydt/index92.html\n",
      "https://www.nfu.edu.cn/xydt/index93.html\n",
      "https://www.nfu.edu.cn/xydt/index94.html\n",
      "https://www.nfu.edu.cn/xydt/index95.html\n",
      "https://www.nfu.edu.cn/xydt/index96.html\n",
      "https://www.nfu.edu.cn/xydt/index97.html\n",
      "https://www.nfu.edu.cn/xydt/index98.html\n",
      "https://www.nfu.edu.cn/xydt/index99.html\n",
      "https://www.nfu.edu.cn/xydt/index100.html\n",
      "https://www.nfu.edu.cn/xydt/index101.html\n",
      "https://www.nfu.edu.cn/xydt/index102.html\n",
      "https://www.nfu.edu.cn/xydt/index103.html\n",
      "https://www.nfu.edu.cn/xydt/index104.html\n",
      "https://www.nfu.edu.cn/xydt/index105.html\n"
     ]
    }
   ],
   "source": [
    "colloge_url_crawl.NFU_NEWS_URL(\"xydt\",106)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
